package cn.iocoder.yudao.module.project.dal.mysql.kismaterielexwarehouserecycle;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.project.dal.dataobject.kismaterielexwarehouserecycle.KisMaterielExWarehouseRecycleDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.project.controller.admin.kismaterielexwarehouserecycle.vo.*;

/**
 * 物料出库单作废信息 Mapper
 *
 * @author 武汉华诚
 */
@Mapper
public interface KisMaterielExWarehouseRecycleMapper extends BaseMapperX<KisMaterielExWarehouseRecycleDO> {

    default PageResult<KisMaterielExWarehouseRecycleDO> selectPage(KisMaterielExWarehouseRecyclePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KisMaterielExWarehouseRecycleDO>()
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getExWarehouseId, reqVO.getExWarehouseId())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getExCode, reqVO.getExCode())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getOrderCode, reqVO.getOrderCode())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getType, reqVO.getType())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getCode, reqVO.getCode())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getCodeNum, reqVO.getCodeNum())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getSpecification, reqVO.getSpecification())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getCartonCode, reqVO.getCartonCode())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getCartonJson, reqVO.getCartonJson())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getSubmitStatus, reqVO.getSubmitStatus())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getMaterialStatus, reqVO.getMaterialStatus())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getRacketModel, reqVO.getRacketModel())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getSheetNum, reqVO.getSheetNum())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getWeight, reqVO.getWeight())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getCutSize, reqVO.getCutSize())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getKnivesNum, reqVO.getKnivesNum())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getAmount, reqVO.getAmount())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getMaterialsCut, reqVO.getMaterialsCut())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getAddLayers, reqVO.getAddLayers())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getMaterialCheck, reqVO.getMaterialCheck())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getIssuMaterials, reqVO.getIssuMaterials())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getOperator, reqVO.getOperator())
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(KisMaterielExWarehouseRecycleDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(KisMaterielExWarehouseRecycleDO::getRecycleId));
    }

    default PageResult<KisMaterielExWarehouseRecycleDO> detailByExCode(KisMaterielExWarehouseRecyclePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KisMaterielExWarehouseRecycleDO>()
                .eqIfPresent(KisMaterielExWarehouseRecycleDO::getExCode, reqVO.getExCode())
                .orderByDesc(KisMaterielExWarehouseRecycleDO::getExWarehouseId));
    }

}